package command;

import java.util.ArrayList;

public class Waiter {
    private ArrayList<Command> orders = new ArrayList<>();

    public void takeOrder(Command command) {
        orders.add(command);
        System.out.println("已记录订单：" + command);
    }

    // 提交订单至后厨执行
    public void submitOrders() {
        System.out.println("--- 开始处理订单 ---");
        for (Command order : orders) {
            order.execute(); // 触发命令执行:ml-citation{ref="3,5" data="citationList"}
        }
        orders.clear();
    }
}

